package cn.groupmarket.test.logicLink.model1.factory;

import cn.groupmarket.api.response.Response;

import cn.groupmarket.test.logicLink.model1.logic.Node1;
import cn.groupmarket.test.logicLink.model1.logic.Node2;
import cn.groupmarket.types.design.framework.link.model1.ILogicLink;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class Rule01TradeRuleFactory {

    @Resource
    private Node1 node1;
    @Resource
    private Node2 node2;

    public ILogicLink<String,Rule01TradeRuleFactory.DynamicContext, Response<String>> openLogicLink() {
        node1.appendNext(node2);
        return node1;
    }

    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    public static class DynamicContext{
        private String age;
    }
}
